﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DanhMuc.ascx.cs" Inherits="CuoiHoi.UserControls.DanhMuc" %>
<%  if (TbTinTuc!=null)
    {
        string patch = "";
        for (int i = 0; i < TbTinTuc.Rows.Count; i++)
        {
            patch = GetRouteUrl("ChiTietDanhMuc"
                     , new
                     {
                         Title = CuoiHoi.Router.NonUnicode(TbTinTuc.Rows[i]["TieuDe"].ToString().Replace("\"","")),
                         Id = TbTinTuc.Rows[i]["idTinTuc"].ToString(),
                         IdDanhMuc = TbTinTuc.Rows[i]["idTheLoai"].ToString(),
                         TitleDanhMuc = CuoiHoi.Router.NonUnicode(TbTinTuc.Rows[i]["TenTheLoai"].ToString().Replace("\"", "")),
                     });
%>
<div class="media">
    <a rel="nofollow" class="pull-left"
        href='<% Response.Write(patch);%>'>
        <% if (TbTinTuc.Rows[i]["AnhDaiDien"].ToString() != "") %>
        <% Response.Write("<img class='media-object img-thumbnail' alt='" + TbTinTuc.Rows[i]["TieuDe"].ToString() + "' style='width: 128px; height: 128px;' src='../images/" + TbTinTuc.Rows[i]["AnhDaiDien"].ToString() + "'/>");%>
    </a>
    <div class="media-body">
        <a rel="nofollow" href="<% Response.Write(patch);%>">
            <h3 class="media-heading"><% Response.Write(TbTinTuc.Rows[i]["TieuDe"].ToString()); %>
            </h3>
        </a>
        
        <%  Response.Write(TbTinTuc.Rows[i]["MoTa"].ToString()); %>
        
        <i style="margin-top:5px; display:block; font-weight:bold"><%  Response.Write(DateTime.Parse(TbTinTuc.Rows[i]["NgayDang"].ToString()).ToShortDateString()); %> </i>
        <ul class="pager">
            <li class="next"><a rel="nofollow" href="<% Response.Write(patch);%>">Chi tiết
                &rarr;</a></li>
        </ul>
    </div>
</div>
<%}
    }%>